import {DarkTheme, DefaultTheme, Theme} from '@react-navigation/native';
import {ProviderProps} from '@ant-design/react-native';
import {Colors} from './Colors';

// 定义单个主题的类型结构
interface ThemeConfig {
  antd: ProviderProps['theme'];
  navigation: Theme;
}

// 定义整个themes对象的类型
export type ThemeMode = 'light' | 'dark';
export type ThemesType = Record<ThemeMode, ThemeConfig>;

export const themes: ThemesType = {
  light: {
    antd: {
      primary_button_fill: Colors.primary,
      primary_button_fill_tap: Colors.primaryLight,
      brand_primary: Colors.primary,
    },
    navigation: {
      ...DefaultTheme,
      colors: {
        ...DefaultTheme.colors,
        primary: Colors.primary,
        text: Colors.textLight
      },
    },
  },
  dark: {
    antd: {},
    navigation: {
      ...DarkTheme,
      colors: {
        ...DarkTheme.colors,
        primary: Colors.primaryDark, // 为深色主题明确指定主颜色
        text: Colors.textDark
      },
    },
  },
};
